﻿define(function (require, exports, module) {
    var sTpl = require("./index.html");
    require("./index.css");
    var vueComponent = Vue.extend({
        template: sTpl,
        name: 'm-side-tree',
        template: sTpl,
        props: ['tree'],
        data: function () {
            return {};
        },
        methods: {
            nodeClick: function (node) {

                if (node.children && node.children.length > 0) {
                    node.collapsed = !node.collapsed;
                    return false;
                }
                if (node.url) {
                    this.$emit('inner-page-add', node);
                    return true;
                }
            }
        },
        created: function () {

        },
        mounted: function () {

            // var slimScroll = require("lib/jquery.slimscroll.js");
            // slimScroll.call($(".m-side-tree"), {
            //     height: outerHeight - 36 + 'px',
            //     width: '180px'
            // })


        }
    });


    Vue.component('m-side-tree', vueComponent); //都全局注册 同时exports

    module.exports = vueComponent;
});